package com.dingpeikeji.quickdeer.modules.rentproduct.entity;

import java.lang.reflect.Field;
import java.util.Map;

import com.google.common.collect.Maps;

/**
 * 存储过程父bean
 */
public class CommonProcedure {
	// 返回状态的取值
	private static int RETURN_FLAG_SUCCESS = 0; // 成功
	
	protected Map<String,Object> param;
	
	// 出参
	private Integer returnflag;
	private String returnmsg;
	
	public CommonProcedure(){
		param = Maps.newHashMap();
	}
	
	/**
	 * 判断存储过程调用是否成功
	 * @return
	 */
	public boolean success(){
		if(this.getReturnflag() != null && this.getReturnflag() == RETURN_FLAG_SUCCESS ){
			return true;
		}
		return false;
	}
	
	public Map<String,Object> getParam() {
		return param;
	}
	
	public Integer getReturnflag() {
		if(param.get("returnflag") == null){
			return null;
		}
		return (Integer) param.get("returnflag");
	}

	public String getReturnmsg() {
		if(param.get("returnmsg") == null){
			return null;
		}
		return (String) param.get("returnmsg");
	}
	
}
